// 飞书API相关类型定义
export interface FeishuConfig {
  FEISHU_APP_ID: string;
  FEISHU_APP_SECRET: string;
  VERIFICATION_TOKEN: string;
}

// OpenAI API相关类型定义
export interface OpenAIConfig {
  OPENAI_API_KEY: string;
  OPENAI_BASE_URL: string;
}

// 应用配置类型定义
export interface AppConfig extends FeishuConfig, OpenAIConfig {
  PORT: number;
}

// 处理消息的类型定义
export interface ProcessedMessages {
  [key: string]: number;
}

// 日志记录器接口
export interface Logger {
  info: (message: string) => void;
  error: (message: string) => void;
}

// 飞书消息内容
export interface FeishuMessageContent {
  text?: string;
  content?: any[];
  [key: string]: any;
}

// 飞书事件回调的消息
export interface FeishuMessage {
  message_id: string;
  message_type: string;
  content: string;
  [key: string]: any;
}

// 飞书事件
export interface FeishuEvent {
  message?: FeishuMessage;
  sender?: {
    sender_id?: {
      open_id?: string;
      [key: string]: any;
    };
    [key: string]: any;
  };
  [key: string]: any;
}

// 飞书Webhook请求体
export interface FeishuWebhookBody {
  challenge?: string;
  header?: any;
  event?: FeishuEvent;
  [key: string]: any;
}

// AI消息
export interface AIMessage {
  role: string;
  content: string;
  name?: string;
}

// 导入任务结果
export interface ImportTaskResult {
  ticket: string;
  type: string;
  job_status: number;
  job_error_msg: string;
  token: string;
  url: string;
  extra?: string[];
}

// 飞书API响应
export interface FeishuResponse {
  code: number;
  msg: string;
  tenant_access_token?: string;
  data?: {
    ticket?: string;
    file_token?: string;
    result?: ImportTaskResult;
    items?: any[];
    [key: string]: any;
  };
} 